<?
        require_once("../inc/models/orders_model.php");
        $results = GetOrders();
?>

<!DOCTYPE html>
<html lang="en">
        <?php include('../inc/header.php'); ?>
        <body>
        <?php include('../inc/navigation.php'); ?>
        <div class="span9">
        	<div class="row-fluid">
		        <h2>Orders</h2>	        
		        <p class = "btn btn-success">
					<a style="color:white;" href="create.php">Create</a>			
				</p>
				<p></p>
	        	
	        	<table class="table table-striped table-bordered table-condensed table-hover">
	                <thead>                    
	            		<th>Customer ID</th><th>Amount</th><th>Actions</th>
	            	</thead>
	            	<? while($rs = $results->fetch_assoc()): ?>
	                <tr>
	                    <td><?=$rs['Customer_id']?></td>
	                    <td><?=$rs['amount']?></td>
	                    <td>
	                        <a href="details.php?id=<?=$rs['id']?>">Details</a>
	                        <a href="edit.php?id=<?=$rs['id']?>">Edit</a>
	                        <a href="delete.php?id=<?=$rs['id']?>"onClick="return confirm('Are you sure you want to delete this entry?')">Delete</a>
	                    </td>
	                </tr>
	            	<? endwhile; ?>
	        	</table>
	     	</div>
         </div>
         <!-- All Bootstrap JavaScript Files -->
       <script src="../inc/bootstrap/js/jquery.js"></script>
       <script src="../inc/bootstrap/js/bootstrap.js"></script>
    </body>
</html>